package com.saret.utils;

import com.google.inject.Binder;
import com.google.inject.name.Names;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * @author biniam.gebremichael
 * @since 12/28/11
 */
public class BindUtil {

     public static void bindProperties(Binder binder, File file) {
        Properties properties = new Properties();
        try {
            properties.load(new FileReader(file));
            Names.bindProperties(binder, properties);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
